package com.hotec.PROJECT_NAME.modules.cmd;


import com.hotec.PROJECT_NAME.modules.cmd.support.Command;
import com.hotec.PROJECT_NAME.modules.cmd.support.CommandContext;
import com.hotec.PROJECT_NAME.modules.cmd.interceptor.CommandInterceptor;

/**
 * Created by ldz666 on 2022/9/14.
 */
public class CommandExecutorImpl implements CommandExecutor {
    private final CommandInterceptor first;
    private final CommandContext commandContext;

    public CommandExecutorImpl(CommandInterceptor first, CommandContext commandContext) {
        this.first = first;
        this.commandContext = commandContext;
    }

    @Override
    public <T> T execute(Command<T> command) {
        return first.execute(this.commandContext, command);
    }
}
